//
//  Poster2CollectionViewCell.m
//  IComic_Stone
//
//  Created by 琳琳 on 15-3-23.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "Poster2CollectionViewCell.h"

@implementation Poster2CollectionViewCell
- (void)dealloc
{
    [_posterImageView release];
    [_posterLabel release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.posterImageView = [[UIImageView alloc] init];
        self.posterImageView.backgroundColor = [UIColor blueColor];
        [self.contentView addSubview:self.posterImageView];
        [_posterImageView release];
        
        self.posterLabel = [[UILabel alloc] init];
        self.posterLabel.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:self.posterLabel];
        [_posterLabel release];
    }
    return self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    CGFloat wight = self.contentView.frame.size.width;
    CGFloat height = self.contentView.frame.size.height;
    self.posterImageView.frame = CGRectMake(0, 0, wight, height * 2 / 3);
    self.posterLabel.frame = CGRectMake(0, height * 2 / 3, wight, height / 3);
}
@end
